#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	char arr[100];
	while (gets(arr) != NULL)
	{
		char* s = arr; int upalph = 0, lowalph = 0, num = 0, theelse = 0, all = 0;
		while (*s != '\0')
		{
			if (*s >= 65 && *s <= 90)
			{
				upalph++; s++; all++;
			}
			else if (*s >= 97 && *s <= 122)
			{
				lowalph++; s++; all++;
			}
			else if (*s >= 48 && *s <= 57)
			{
				num++; s++; all++;
			}
			else
			{
				theelse++; s++; all++;
			}
		}
		printf("%d %d %d %d %d\n", upalph, lowalph, num, theelse, all);

	}


	return 0;
}